<template>

  <view>
    <view class="artive h5-padding">
      <view class="h1">
        {{details&&details.title}}
      </view>
      <view class="time">
        {{createTime }}
      </view>
      <view class="content">
        {{details&&details.content}}
      </view>
    </view>
    <Tabbar :current="1"></Tabbar>
  </view>
</template>

<script>
import {emSysUserMessageInfo} from '@/api/message'
export default {
  data() {
    return {
      //详情数据
      details:{}
    };
  },
  onLoad(opt){
    this.emSysUserMessageInfo(opt.id)
  },
  computed:{
    createTime(){
      return this.$moment(this.details?.createTime?? this.$moment().format('yyyy/MM/DD')).format('yyyy/MM/DD')
    }
  },
  methods: {
    //系统详情消息
    emSysUserMessageInfo(id){
      emSysUserMessageInfo(id).then(res=>{
        const {code,result} = res
        if(code===200){
          this.details = result
          uni.setNavigationBarTitle({
            title: this.details.title
          });
        }
      }).catch(err=>{
        console.log (err)
      })
    }
  }
}
</script>

<style lang="scss" scope>
@import '@/style/details'

</style>
<style lang="scss" scope>
.time{
  font-size: 28rpx;
  color: #a6a6a6;
}
.content{
  font-size: 30rpx;
  line-height: 30rpx;
  letter-spacing: .5rpx;
  margin: 17rpx 0 3rpx;
  color: #333;
}
</style>
